package orchestration.android.execution.tasks;

import android.app.Activity;
import android.content.Intent;
import orchestration.android.RunExecutionActivity;
import orchestration.android.execution.exceptions.TaskExecutionException;
import orchestration.persistence.exceptions.UnsupportedTypeException;

public class EndProcessTask extends AndroidTask {

	public EndProcessTask(String id) {
		super(id);
	}

	@Override
	public void onExecute(RunExecutionActivity rea) throws TaskExecutionException {
		Intent i= rea.getIntent();
		try {
			fillIntentExtras(rea, i);
		} catch (UnsupportedTypeException e) {
			throw new TaskExecutionException(e);
		}
		rea.setResult(Activity.RESULT_OK, i);
	}

}
